// Parser.h : Declaration of the CParser

#pragma once
#include "resource.h"       // main symbols
#include "mergeparser.h"
// IParserCallback
[
	object,
	uuid("01143277-7539-4D21-BAF7-100F35131DA9"),
	dual,	helpstring("IParserCallback Interface"),
	pointer_default(unique)
]
__interface IParserCallback : IDispatch
{

	[id(1), helpstring("method OnParse")] HRESULT OnParse( [in] BSTR text, [in] MergeTokenType tokenType);
	[id(3), helpstring("method OnBeginParse")] HRESULT OnBeginParse(void);
	[id(4), helpstring("method OnEndParse")] HRESULT OnEndParse(void);
};

// IParser
[
	object,
	uuid("13F8331A-71B5-4181-B870-21FCB38C410D"),
	dual,	helpstring("IParser Interface"),
	pointer_default(unique)
]
__interface IParser : IDispatch
{
	
	[id(1), helpstring("method Parse")] HRESULT Parse([in] BSTR text, IParserCallback* pCallback);
};



// CParser

[
	coclass,
	threading("apartment"),
	vi_progid("RegionParser.Parser"),
	progid("RegionParser.Parser.1"),
	version(1.0),
	uuid("C9A5376B-3570-411E-80D3-B1C66F1DA89B"),
	helpstring("Parser Class")
]
class ATL_NO_VTABLE CParser : 
	public IParser
{
public:
	CParser()
	{
	}


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:

	STDMETHOD(Parse)(BSTR text, IParserCallback* pCallback);
};

